@echo off

:main
:: remove dir
if exist backup rd /S /Q backup

:: create dir
if not exist backup mkdir backup

:: copy
call:copy_dir bin
call:copy_dir scripts
call:copy_dir venv
call:copy_file backup.bat
call:copy_file backup.vbs
call:copy_file Main.py
call:copy_file Main.pyw
call:rmdir backup\venv\Lib\site-packages\_pyinstaller_hooks_contrib
call:rmdir backup\venv\Lib\site-packages\pyinstaller_hooks_contrib-2022.8.dist-info

:: pause
pause
goto:eof

:copy_dir
xcopy %1\* backup\%1\ /S /E /Y
goto:eof

:copy_file
xcopy %1 backup\ /Y
goto:eof

:rmdir
if exist %1 rd /S /Q %1
goto:eof
